package cn.owen;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;




@EnableAutoConfiguration
@ServletComponentScan
@SpringBootApplication
@ComponentScan
@EnableScheduling
@MapperScan("cn.owen.mapper")
public class Application implements EmbeddedServletContainerCustomizer {
	
    /*@Configuration
    static class WebMvcConfigurer extends WebMvcConfigurerAdapter {
        public void addInterceptors(InterceptorRegistry registry) {
            registry.addInterceptor(new UserSecurityInterceptor()).addPathPatterns("/**");
            //registry.addInterceptor(new AccountSecurityInterceptor()).addPathPatterns("/**").excludePathPatterns("/font/login**");
            super.addInterceptors(registry);
        }
    }*/

	@Override
	public void customize(ConfigurableEmbeddedServletContainer container) {
		container.setPort(8200);  //端口号
        container.setSessionTimeout(1800);//session失效时间 单位为S
	}
    /**
     * Start
     */
    public static void main(String[] args) {
    	ConfigurableApplicationContext ac=SpringApplication.run(Application.class, args);
    	//String[] activeProfiles = ac.getEnvironment().getActiveProfiles();
    }
    
   
   
}
